﻿

using System.Collections.Generic;
using UnityEngine;

namespace com.tdb.foundation
{
    public static class ListExtensions
    {
        
        public static void Shuffle<T>(this List<T> list)
        {
            List<T> result = new List<T>();
            while (list.Count > 0)
            {
                int index = Random.Range(0, list.Count);
                result.Add(list[index]);
                list.RemoveAt(index);
            }
            list.AddRange(result);
        }    
    }
}
